package initialization;

public class VerifyFinalize {
    @Override
    protected void finalize() throws Throwable {
        System.out.println("调用了finalize方法");
        super.finalize();
    }
    public static void main(String[] args) {
        VerifyFinalize t = new VerifyFinalize();
        t = null;
        System.gc();

        VerifyFinalize t1 = new VerifyFinalize();
        t1 = null;
        System.gc();
        System.runFinalization();
    }

}
